import { ref as vRef, reactive as vReactive } from 'vue';
export const base64ToBytes = (base64) => Uint8Array.from(atob(base64), (m) => m.codePointAt(0));

export function defineProperties() {
  const ref = (properties) => {
    if (properties !== null && typeof properties === 'object') {
      for (const key in properties) {
        Object.defineProperty(properties, key, {
          get(target, key, value) {
            console.log('----', target, key, value);
            return target[key];
          },
        });
      }
    }
    return vRef(properties);
  };
  const reactive = () => {
    return vReactive();
  };
  return {
    ref,
    reactive,
  };
}
